home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / AmigaTalk / testfiles / TestMenu < prev    next >
Text File  |  2002-10-27  |  965b  |  42 lines

  1. aScreen <- Screen new: 16r40D20001
  2. aScreen          open: 'Testing Menus:'
  3.  
  4. aWindow <- Window new: 'Test the Menus:'
  5.  
  6. aWindow setFlags:      16r1008 "ACTIVATE + CLOSE"
  7. aWindow setIDCMPFlags: 16r300  "MENUPICK + CLOSEWINDOW"
  8.  
  9. aWindow openOnScreen: aScreen
  10.  
  11. prj   <- MenuItem new: #(1 'PROJECT' ''  0 0)
  12. load  <- MenuItem new: #(2 'Load...' 'L' 0 'load')
  13. about <- MenuItem new: #(2 'About..' 'I' 0 'about')
  14. bar   <- MenuItem new: #(2 -1        ''  0 0)
  15. quit  <- MenuItem new: #(2 'Quit'    'Q' 0 'quit')
  16. end   <- MenuItem new: #(0 ''        ''  0 0)
  17.  
  18. menuStrip <- NewMenu new: 6
  19.  
  20. menuStrip setItem: 1 to: prj
  21. menuStrip setItem: 2 to: load
  22. menuStrip setItem: 3 to: about
  23. menuStrip setItem: 4 to: bar
  24. menuStrip setItem: 5 to: quit
  25. menuStrip setItem: 6 to: end
  26.  
  27. menuStrip registerTo: aWindow
  28.  
  29. menuStrip displayMenus
  30.  
  31. rval <- String  new
  32. rval <- aWindow handleIntuition
  33.  
  34. ('User selected ', rval) print
  35.  
  36. menuStrip hideMenus
  37.  
  38. aWindow close
  39. aScreen close
  40.  
  41. menuStrip dispose
  42.